1 using UnityEngine;
2 using
UnityEngine.UI;
3
4 public
class GameOverScoreDisplay : MonoBehaviour {
5     ScoreAbsorber scoreAbsorber;
6     Text text;
7
8     
// Use this for initialization
9     
void Start()
10     {
11         scoreAbsorber = FindObjectOfType<ScoreAbsorber>();
12         text = GetComponent<Text>();
13     }
14
15     
// Update is called once per frame
16     
void Update()
17     {
18         text.text =
"Score: " + scoreAbsorber.score;
19     }
20 }


Gõ tìm kiếm nhanh...